package cn.lg.soar.system.auth.entity;

import cn.lg.soar.core.util.easyexcel.converters.BooleanConverter;
import cn.lg.soar.database.base.entity.BaseEntity;
import cn.lg.soar.database.base.entity.ITenantEntity;
import cn.lg.soar.database.translate.TranslateByEntity;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.Version;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;

/**
 * 岗位
 * @author luguoxiang
 * @date 2022/4/12
 * 开源项目：https://gitee.com/lgx1992/lg-soar 求star！请给我star！请帮我点个star！
 */
@EqualsAndHashCode(callSuper = true)
@Getter
@Setter
@ApiModel(value = "Post", description = "岗位(职位)")
@TableName("lg_sys_post")
public class Post extends BaseEntity implements ITenantEntity {

    private static final long serialVersionUID = -652064669650119926L;

    @ApiModelProperty(value = "主键")
    @TableId
    private Long id;

    @TranslateByEntity(value = Org.class)
    @ApiModelProperty(value = "组织机构id")
    private Long orgId;

    @ApiModelProperty(value = "名称")
    private String name;

    @ApiModelProperty(value = "别名")
    private String alias;

    @ApiModelProperty(value = "描述")
    private String remark;

    @ExcelProperty(value = "是否禁用", converter = BooleanConverter.class)
    private Boolean disabled;

    @ApiModelProperty(value = "租户id")
    @JsonIgnore
    @TableField(select = false)
    private Integer tenantId;

    @Version
    @ApiModelProperty(value = "乐观锁")
    protected Integer version;

    @Override
    public Long primaryKey() {
        return id;
    }
}
